.class Lrexsee/service/RexseePushHttpListener$2;
.super Ljava/lang/Object;
.source "RexseePushHttpListener.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/service/RexseePushHttpListener;->refresh(ZZ)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/service/RexseePushHttpListener;

.field private final synthetic val$finishAlert:Z

.field private final synthetic val$progress:Z


# direct methods
.method constructor <init>(Lrexsee/service/RexseePushHttpListener;ZZ)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    iput-boolean p2, p0, Lrexsee/service/RexseePushHttpListener$2;->val$progress:Z

    iput-boolean p3, p0, Lrexsee/service/RexseePushHttpListener$2;->val$finishAlert:Z

    .line 227
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 9

    .prologue
    .line 230
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # invokes: Lrexsee/service/RexseePushHttpListener;->getItems()[Lrexsee/service/HttpItem;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$2(Lrexsee/service/RexseePushHttpListener;)[Lrexsee/service/HttpItem;

    move-result-object v7

    .line 231
    .local v7, "items":[Lrexsee/service/HttpItem;
    if-nez v7, :cond_1

    .line 232
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v1, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    invoke-virtual {v1}, Lrexsee/service/RexseePushHttpListener;->getInterfaceName()Ljava/lang/String;

    move-result-object v1

    const-string v2, "No available push url."

    invoke-virtual {v0, v1, v2}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 246
    :cond_0
    :goto_0
    return-void

    .line 235
    :cond_1
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_2

    iget-boolean v0, p0, Lrexsee/service/RexseePushHttpListener$2;->val$progress:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    sget-object v1, Lrexsee/core/lang/RexseeLanguage;->PROGRESS_ONGOING:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lrexsee/core/progress/RexseeProgressDialog;->show(Ljava/lang/String;)V

    .line 236
    :cond_2
    const/4 v6, 0x0

    .local v6, "i":I
    :goto_1
    array-length v0, v7

    if-lt v6, v0, :cond_5

    .line 241
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 242
    iget-boolean v0, p0, Lrexsee/service/RexseePushHttpListener$2;->val$progress:Z

    if-eqz v0, :cond_3

    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    invoke-virtual {v0}, Lrexsee/core/progress/RexseeProgressDialog;->hide()V

    .line 243
    :cond_3
    iget-boolean v0, p0, Lrexsee/service/RexseePushHttpListener$2;->val$finishAlert:Z

    if-eqz v0, :cond_4

    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    sget-object v1, Lrexsee/core/lang/RexseeLanguage;->PROGRESS_REFRESH_FINISH:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lrexsee/core/application/RexseeApplication;->alert(Ljava/lang/String;)V

    .line 244
    :cond_4
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$3(Lrexsee/service/RexseePushHttpListener;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onPushRefreshFinished"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    goto :goto_0

    .line 237
    :cond_5
    new-instance v0, Ljava/lang/StringBuilder;

    aget-object v1, v7, v6

    iget-object v1, v1, Lrexsee/service/HttpItem;->url:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "?id="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    aget-object v1, v7, v6

    iget-object v1, v1, Lrexsee/service/HttpItem;->userId:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "&password="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    aget-object v1, v7, v6

    iget-object v1, v1, Lrexsee/service/HttpItem;->userPassword:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "&last="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    aget-object v2, v7, v6

    iget-object v2, v2, Lrexsee/service/HttpItem;->url:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lrexsee/service/RexseePushHttpListener;->getLastMessageId(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    .line 238
    .local v8, "url":Ljava/lang/String;
    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpContext:Landroid/content/Context;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$4(Lrexsee/service/RexseePushHttpListener;)Landroid/content/Context;

    move-result-object v0

    iget-object v1, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    invoke-virtual {v1}, Lrexsee/service/RexseePushHttpListener;->getTimeout()I

    move-result v1

    mul-int/lit16 v1, v1, 0x3e8

    aget-object v2, v7, v6

    iget-object v2, v2, Lrexsee/service/HttpItem;->encoding:Ljava/lang/String;

    invoke-static {v0, v8, v1, v2}, Lrexsee/service/RexseePushHttpListener;->getData(Landroid/content/Context;Ljava/lang/String;ILjava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 239
    .local v5, "data":Ljava/lang/String;
    if-eqz v5, :cond_6

    iget-object v0, p0, Lrexsee/service/RexseePushHttpListener$2;->this$0:Lrexsee/service/RexseePushHttpListener;

    # getter for: Lrexsee/service/RexseePushHttpListener;->httpContext:Landroid/content/Context;
    invoke-static {v0}, Lrexsee/service/RexseePushHttpListener;->access$4(Lrexsee/service/RexseePushHttpListener;)Landroid/content/Context;

    move-result-object v0

    const-string v1, "http"

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    aget-object v4, v7, v6

    iget-object v4, v4, Lrexsee/service/HttpItem;->url:Ljava/lang/String;

    invoke-static/range {v0 .. v5}, Lrexsee/service/RexseePush;->add(Landroid/content/Context;Ljava/lang/String;JLjava/lang/String;Ljava/lang/String;)V

    .line 236
    :cond_6
    add-int/lit8 v6, v6, 0x1

    goto/16 :goto_1
.end method
